package com.jarveis.dbs.demo.service;

import org.apache.log4j.Logger;

import com.jarveis.dbs.core.Service;
import com.jarveis.frame.util.Param;

/**
 * @funcId 10001
 * @author liuguojun
 * @date 2015-11-14
 */
public class HelloService implements Service {

	private static final Logger logger = Logger.getLogger(HelloService.class);

	public Param callService(Param in) {
		Param out = null;
		try {
			out = new Param("Resp");
			
			String name = in.getBody().getString("@name");
			
			out.getHead().setProperty(Param.LABEL_ERROR, Param.ERROR_SUCCESS);
			out.getBody().setProperty("@message", "Hello," + name);
		} catch (Exception ex) {
			out.setProperty(Param.LABEL_ERROR, Param.ERROR_EXCEPTION);
			logger.error(ex.getMessage(), ex);
		}

		return out;
	}
}
